﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YXShop.DALFactory;
using YXShop.IDAL.Accessories;

namespace YXShop.BLL.Accessories
{
   public class Questionnaire
    {
       private readonly IQuestionnaire dal = DataAccess.CreateQuestion();
       public Questionnaire()
       {
       }
       #region "Database Operation"
       /// <summary>
       /// 增加
       /// </summary>
       /// <param name="model"></param>
       /// <returns></returns>
       public int Add(YXShop.Model.Accessories.Questionnaire model)
       {
           return dal.Add(model);
       }
       /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
       public void Update(YXShop.Model.Accessories.Questionnaire model)
       {
           dal.Update(model);
       }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
       public void Delete(int id)
       {
           dal.Delete(id);
       }
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ids"></param>
       public void DeleteAll(string ids)
       {
           dal.DeleteAll(ids);
       }
       #endregion

       #region "Data Load"
       /// <summary>
        /// 根据ID查对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
       public YXShop.Model.Accessories.Questionnaire GetModelById(int id)
       {
           return dal.GetModelById(id);
       }
       /// <summary>
       /// 得到指定条件列表
       /// </summary>
       /// <param name="uid"></param>
       /// <returns></returns>
       public List<YXShop.Model.Accessories.Questionnaire> GetAll(string strWhere)
       {
           return dal.GetAll(strWhere);
       }
        /// <summary>
        /// 分页
        /// </summary>
        /// <returns></returns>
       public ChangeHope.DataBase.DataByPage GetAllList()
       {
           return dal.GetAllList();
       }
        #endregion
    }
}
